package ${package.Parent}.provider.${cfg.module}.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ${package.Parent}.domain.request.${table.entityPath}.*;
import ${package.Parent}.domain.response.${table.entityPath}.*;
import ${package.Parent}.service.I${entity}Service;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * <p>
 * ${table.comment!} Client 实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@DubboService
@AllArgsConstructor
@Slf4j
public class ${entity}ClientImpl implements I${entity}Client {

    private final I${entity}Service ${entity?uncap_first}Service;

    @Override
    public Page<${entity}PageResponse> find${entity}Page(${entity}PageRequest request) {
        return ${entity?uncap_first}Service.find${entity}Page(request);
    }

    @Override
    public ${entity}DetailResponse find${entity}ById(String id) {
        return ${entity?uncap_first}Service.find${entity}Detail(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void execCreate${entity}(${entity}CreateRequest request) {
        ${entity?uncap_first}Service.create${entity}(request);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void execUpdate${entity}(${entity}UpdateRequest request) {
        ${entity?uncap_first}Service.update${entity}(request);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void execDelete${entity}(${entity}DeleteRequest request) {
        ${entity?uncap_first}Service.delete${entity}(request.getId());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void execBatchDelete${entity}(${entity}BatchDeleteRequest request) {
        ${entity?uncap_first}Service.batchDelete${entity}(request.getIds());
    }
}